package com.hzhq.contract.convert;

import com.hzhq.contract.bean.dto.AdminDTO;
import com.hzhq.contract.bean.entity.Admin;
import com.hzhq.contract.bean.vo.AdminVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author: hzhq1255
 * @mail: hzhq1255@163.com
 * @date: 2021/4/14 21:11
 * @desc:
 */
@Mapper
public interface AdminConvertBasic {

    AdminConvertBasic INSTANCE = Mappers.getMapper(AdminConvertBasic.class);


    AdminDTO poToDto(Admin source);


    Admin dtoToPo(AdminDTO source);


    @Mappings({
            @Mapping(target = "adminId", expression = "java(com.hzhq.contract.util.ConvertUtil.objectIdToString(source.getAdminId()))")
    })
    AdminVO dtoToVo(AdminDTO source);


}
